#!/bin/sh

root=/root/pj
project=mpub
branch=master


workspace=${root}/${project}

if cd ${workspace} ; then

	git fetch

	verOld=`git rev-parse --short origin/${branch}`
	verNew=`git rev-parse --short ${branch}`

	if [ ${verOld} != ${verNew} ]; then
		git checkout .
		echo git merge
	else
		echo "Only Fetch: ${verNew}"
	fi


else
	echo "error: 目录错误"
fi

echo `date +%FT%T`
